<?php
$sec = 10;
if(isset($_REQUEST['url'])){
 $url = (!preg_match("/^[http]+[:\/\/]+[A-Za-z0-9\-_]+\\.+[A-Za-z0-9\.\/%&=\?\-_]+$/i",$_REQUEST['url'])) ? 'index.php' : $_REQUEST['url'];
} else {
 $url = 'index.php';
}

@header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
@header("Content-Type: text/html; charset=windows-1251");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n".
     "<HTML>\n".
     "<HEAD>\n".
     "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=windows-1251\">\n".
     "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"".$sec."; url=".$url."\">\n".
     "<TITLE>REDIRECT</TITLE>\n".
     "<style type=\"text/css\">
       <!--\n
       a:link, a:visited  { color: #748fb3; text-decoration: none }
       a:hover            { color: #4d698d; text-decoration: underline }
       .redirect          { background: #fff }
       .redirecttitle     { color: #600; background: #e89ca0; line-height: 100%; padding: .4em 1em }
       .redirecttext      { border: .1em solid #ccc; background: #fdfefc; font-size: 1.1em; width: 50%; padding: 4em; color: #390;}
       .redirecttext big  { font-size: 1.4em; color: #666; padding-left: 1em; vertical-align: middle }
       .redirecttext p a  { text-decoration: underline }
       .ac                { text-align: center }\n".
     " -->
      </style>
     </HEAD>\n".
     "<table align=\"center\" width=\"100%\" height=\"100%\">
       <tbody>
        <tr>
         <td align=\"center\">
          <div class=\"redirect\">
           <div class=\"redirecttext ac\">
            <p><big id=\"time\"></big></p>
            <p class=\"ac\"><a href=\"".$url."\">".$url."</a></p>
          </div>
         </div>
        </td>
       </tr>
      </tbody>
     </table>\n".
    "<script language=\"javascript\">\n".
     "var line = ".$sec.";\n".
     "timeline();\n".
     "function timeline(){\n".
     "if(line > 0){\n".
     "document.getElementById('time').innerHTML = ' ' + line + ' ';\n".
     "line = line-1;\n".
     "setTimeout(\"timeline()\",1000);\n".
     "} else {\n".
     "document.getElementById('time').innerHTML = '';\n".
     "}\n".
     "}\n".
     "</script>\n".
     "</BODY>\n".
     "</HTML>";
exit();
?>